.class public Llt/noframe/gpsfarmguide/models/ModeItemModel;
.super Ljava/lang/Object;
.source "ModeItemModel.java"


# instance fields
.field private gui_type:I

.field private paid:Z


# direct methods
.method public constructor <init>(I)V
    .locals 1

    .line 21
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x1

    .line 19
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->paid:Z

    .line 22
    iput p1, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->gui_type:I

    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->paid:Z

    return-void
.end method

.method public constructor <init>(IZ)V
    .locals 1

    .line 25
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x1

    .line 19
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->paid:Z

    .line 26
    iput p1, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->gui_type:I

    iput-boolean p2, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->paid:Z

    return-void
.end method

.method private createManualMeasuringModel(I)Llt/noframe/gpsfarmguide/models/MeasuringModel;
    .locals 2

    const/4 v0, 0x1

    if-eq p1, v0, :cond_1

    const/4 v0, 0x2

    if-eq p1, v0, :cond_0

    const/4 p1, 0x0

    move-object v0, p1

    goto :goto_0

    .line 93
    :cond_0
    new-instance v0, Llt/noframe/gpsfarmguide/models/MeasuringModel;

    new-instance v1, Llt/noframe/gpsfarmguide/models/PolygonModel;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/models/PolygonModel;-><init>()V

    invoke-direct {v0, v1, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;-><init>(Llt/noframe/gpsfarmguide/interfaces/Shape;I)V

    .line 94
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    new-instance v1, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;-><init>()V

    invoke-virtual {p1, v1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->setCurrentState(Llt/noframe/gpsfarmguide/states/map_states/MapState;)V

    goto :goto_0

    .line 89
    :cond_1
    new-instance v0, Llt/noframe/gpsfarmguide/models/MeasuringModel;

    new-instance v1, Llt/noframe/gpsfarmguide/models/LineModel;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/models/LineModel;-><init>()V

    invoke-direct {v0, v1, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;-><init>(Llt/noframe/gpsfarmguide/interfaces/Shape;I)V

    .line 90
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    new-instance v1, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;-><init>()V

    invoke-virtual {p1, v1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->setCurrentState(Llt/noframe/gpsfarmguide/states/map_states/MapState;)V

    :goto_0
    return-object v0
.end method


# virtual methods
.method public getDrawable()I
    .locals 2

    .line 30
    iget v0, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->gui_type:I

    const/4 v1, 0x1

    if-eq v0, v1, :cond_3

    const/4 v1, 0x2

    if-eq v0, v1, :cond_2

    const/4 v1, 0x5

    if-eq v0, v1, :cond_1

    const/4 v1, 0x6

    if-eq v0, v1, :cond_0

    const/4 v0, -0x1

    return v0

    :cond_0
    const v0, 0x7f0800db

    return v0

    :cond_1
    const v0, 0x7f0800e2

    return v0

    :cond_2
    const v0, 0x7f0800f4

    return v0

    :cond_3
    const v0, 0x7f0800f5

    return v0
.end method

.method public getGui_type()I
    .locals 1

    .line 68
    iget v0, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->gui_type:I

    return v0
.end method

.method public getMode_name()Ljava/lang/String;
    .locals 2

    .line 45
    iget v0, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->gui_type:I

    const/4 v1, 0x1

    if-eq v0, v1, :cond_3

    const/4 v1, 0x2

    if-eq v0, v1, :cond_2

    const/4 v1, 0x5

    if-eq v0, v1, :cond_1

    const/4 v1, 0x6

    if-eq v0, v1, :cond_0

    const-string v0, ""

    return-object v0

    .line 53
    :cond_0
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f1100e2

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    return-object v0

    .line 51
    :cond_1
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f110120

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    return-object v0

    .line 49
    :cond_2
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f11010f

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    return-object v0

    .line 47
    :cond_3
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f110136

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public isPaid()Z
    .locals 1

    .line 60
    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->paid:Z

    return v0
.end method

.method public showGui(I)V
    .locals 2

    .line 76
    new-instance v0, Llt/noframe/gpsfarmguide/gui/GuiFactory;

    invoke-direct {v0}, Llt/noframe/gpsfarmguide/gui/GuiFactory;-><init>()V

    .line 77
    iget v1, p0, Llt/noframe/gpsfarmguide/models/ModeItemModel;->gui_type:I

    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/models/ModeItemModel;->createManualMeasuringModel(I)Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    invoke-virtual {v0, v1, p1}, Llt/noframe/gpsfarmguide/gui/GuiFactory;->buildGui(ILlt/noframe/gpsfarmguide/models/MeasuringModel;)V

    return-void
.end method
